
function Judge(str) {
  var obj = {}
  for (var i = 0; i < str.length; i++) {
    obj[str.charAt(i)] = obj[str.charAt(i)] || 0
    obj[str.charAt(i)]++
  }
  let maxChar = null
  let maxNum = 0
  for (let key in obj) {
    if (obj[key] > maxNum) {
      maxChar = key
      maxNum = obj[key]
    }
  }
  console.log("出现最多的值为:" + maxChar + '\n' + "出现的次数为:" + maxNum)
}
Judge("aaaabssabcjjddjdj111111111111111jjdacaggf")
